package com.yshkj.payment.entity.medicinal;

import com.yshkj.payment.entity.BaseDomain;
import lombok.Builder;
import lombok.Data;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 药品
 * Created by 唐旭 on 2016/10/1.
 */
@Entity
@Table
@Data
public class Medicinal extends BaseDomain {
    //药品名称
    @Column
    private String name;
    //生产厂家
    @ManyToOne
    @JoinColumn(name = "producer")
    private Producer producer;
    //药品规格
    //例如:藿香正气液10支(10元)/5支(6元)
    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "medicinal")
    private List<Spec> specList = new ArrayList<>();


}
